
from flask import Blueprint
from flask_restful import Api

from comment.utils.output import output_json

index_bp = Blueprint('index', __name__, url_prefix="/index")
index_api = Api(index_bp)

index_api.representation("application/json")(output_json)    # 使用自定义的json格式，替代装饰器的写法

from shopping.resources.index.index_resource import *
# 商品分类的资源类
index_api.add_resource(Shopping_Category, "/category", endpoint="category")

# 添加测试datalist2dict 函数的资源类
index_api.add_resource(Dict_test, "/dict_test", endpoint="dict_test")

# 首页新品推荐的模型类
index_api.add_resource(Shopping_HomeNewProduct, "/home_new_product", endpoint="home_new_product")

# 首页人气热搜的资源类
index_api.add_resource(Shopping_HomeRecommendProduct, "/home_recommend_product", endpoint="home_recommend_product")

# 首页专题广场资源类
index_api.add_resource(Shopping_Recommend_Subject, "/recommend_subject", endpoint="recommend_subject")

